Skip to content

Conversation

asmellby
Copy link
Contributor

Reformat xg27 soc devicetree files according to https://docs.zephyrproject.org/latest/contribute/style/devicetree.html and https://docs.kernel.org/devicetree/bindings/dts-coding-style.html:

  • Sort nodes by unit address or name
  • Sort properties by category and name

Add support for all socs in the xg27 family.

Add three xg27 radio boards: bg27_rb4110b, bg27_rb4111b and xg27_rb4194a.

Copy link

github-actions bot commented Sep 19, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_silabs zephyrproject-rtos/hal_silabs@edbd418 zephyrproject-rtos/hal_silabs@b71ca6e (main) zephyrproject-rtos/hal_silabs@edbd4186..b71ca6e4

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

board_runner_args(jlink "--device=EFR32MG27CxxxF768")
else()
board_runner_args(jlink "--device=EFR32BG27CxxxF768")
endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe:

string(TOUPPER ${CONFIG_SOC} JLINK_DEVICE)
string(SUBSTRING 0 17 ${JLINK_DEVICE} JLINK_DEVICE)
board_runner_args(jlink "--device=${JLINK_DEVICE}")

... can be done in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't have xxx in the middle...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed (it seems the full chip name is sometime accepted by JLink, but not always). We probably need some more robust:

string(REGEX REPLACE "^(EF[RM]32[PFBM]G2[1-9][ABC])[0-9]*(F[0-9]*).*" "\\1xxx\\2" JLINK_DEVICE "${JLINK_DEVICE}")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the risk to have a future rb4119b that does not match with this definition? That's said, I have not better proposal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very low. But if it happens, it doesn't need to include the generic .dtsi file.

default "efr32bg27c230f768im32" if SOC_EFR32BG27C230F768IM32
default "efr32bg27c230f768im40" if SOC_EFR32BG27C230F768IM40
default "efr32bg27c320f768gj39" if SOC_EFR32BG27C320F768GJ39
default "efr32bg27c320f768ij39" if SOC_EFR32BG27C320F768IJ39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you miss the dtsi for this one ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

jhedberg
jhedberg previously approved these changes Sep 22, 2025
Copy link
Member

@jhedberg jhedberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Please update west.yml now that the corresponding module PR was merged.

# SPDX-License-Identifier: Apache-2.0

if(CONFIG_BOARD_XG27_RB4194A)
board_runner_args(jlink "--device=EFR32MG27CxxxF768")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 space indent for cmake

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

@nordicjm nordicjm requested a review from kartben September 22, 2025 09:49
Comment on lines 12 to 13
model = "Silicon Labs BG27-RB4110B";
compatible = "silabs,bg27_rb4110b", "silabs,efr32bg27";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be referring to bg27_rb4111b

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

compatible = "gpio-keys";

button0: button_0 {
gpios = <&gpiob 2 GPIO_ACTIVE_LOW>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

led0 and button0 on the same pin? probably a typo somewhere :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are on the same pin:
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. Then you'll want to disable either buttons or led node initially, or people trying to run the button sample are probably in for a surprise?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. Disabling the LED node in board dts will prevent the blinky sample from working, so that's not a great solution. Maybe just removing the led0 alias in a board overlay for the button sample is the most sensible approach? Could also swap 0 and 1 around, but then the dts nodes don't match the silkscreen on the board...

@asmellby asmellby dismissed stale reviews from jhedberg and Martinhoff-maker via 4b466f8 September 22, 2025 10:22
@asmellby asmellby force-pushed the feature/xg27-board-support branch 2 times, most recently from 4b466f8 to 997d795 Compare September 22, 2025 10:24
@github-actions github-actions bot removed the DNM (manifest) This PR should not be merged (controlled by action-manifest) label Sep 22, 2025
@tomi-font tomi-font removed their request for review September 22, 2025 13:01
@zephyrbot zephyrbot added the area: Samples Samples label Sep 22, 2025
Copy link
Contributor

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebase is needed

@asmellby asmellby force-pushed the feature/xg27-board-support branch from a7b54e5 to 8507332 Compare September 23, 2025 15:58
Set #address-cells and #size-cells on usart0. Since usarts can
be used for both UART and SPI, this property shouldn't be set
in SoC-level DTS, since it makes it harder to switch compatible.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Reformat devicetree files:
 * Sort nodes by unit address or name
 * Sort properties by category and name

Add missing properties to existing nodes.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Add missing peripheral and clock nodes for xg27.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Add efr32bg27 and efr32mg27 socs.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Use cryptoacc variant on all xg27 socs.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Add 3 xg27 radio boards:

* bg27_rb4110b
* bg27_rb4111b
* xg27_rb4194a

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Button 0 and LED 0 share a GPIO pin on bg27 boards. Remove the
`led0` alias in a board overlay to make the button sample work
out of the box.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
@asmellby asmellby force-pushed the feature/xg27-board-support branch from 8507332 to 81f94f1 Compare September 23, 2025 15:59
Copy link

Please retry analysis of this Pull-Request directly on SonarQube Cloud

@asmellby asmellby requested a review from nordicjm September 24, 2025 07:01
Copy link
Contributor

@kartben kartben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are probably a few other samples that might have incorrect out-of-the-box experience due to button/led overlap but this is probably fine given that the caveat is called out in the board's documentation

@cfriedt cfriedt merged commit d3f531c into zephyrproject-rtos:main Sep 24, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants